<?php 
require_once('../db/connect.php'); 
$menuSuperior = $_POST['menuSuperior'];
$menuVertical = $_POST['menuVertical'];

//┌─────────────────┐
//Si viene vacio
if($menuSuperior == ''){
?>
    <select disabled="disabled">
    <option>Seleccione</option>
    </select>
<?php 
return;
}
//└─────────────────┘

mysql_select_db($database_victoria, $victoria );
$query_rsListar = "
SELECT
  PRO_CODIGO,
  PRO_PADRE,
  PRO_NOMBRE_OPCION
FROM programa
WHERE PRO_UBICACION = 'Vertical'
AND PRO_TIPO = 'Menu'
AND PRO_ESTADO = 1
AND PRO_PADRE = ".$menuSuperior."
ORDER BY PRO_NOMBRE_OPCION
";
$rsListar = mysql_query($query_rsListar, $victoria );
$numero = mysql_num_rows($rsListar);		
if($numero == 0){
?>
	<select class=" validar " name="menuVertical" id="menuVertical" >
    <option value="" >Seleccione</option>
    </select>
<?php 
}else{
?>
	<select class=" validar " name="menuVertical" id="menuVertical"  onchange="submenuShow()" >
		<option value="">Seleccione</option>		
		<?php 
		while($row_rsListar = mysql_fetch_assoc($rsListar)){
			$selected = ($menuVertical == $row_rsListar['PRO_CODIGO'] ? 'selected="selected"' : '' );     
		?>
		<option <?php echo $selected?>  value="<?php echo $row_rsListar['PRO_CODIGO'];?>"><?php echo $row_rsListar['PRO_NOMBRE_OPCION'];?></option>
		<?php }?>
	</select>
<?php 
}
?>    
    